package org.zavgame.rest;

import java.io.PrintWriter;
import java.io.StringWriter;

public class ExceptionUtils
{

   /**
    * Get the stacktrace as a string to the future print stacktrace to the client.
    * 
    * @param e
    * @return
    */
   public static String stacktraceToString(Throwable e)
   {
      StringWriter sw = new StringWriter();
      PrintWriter pw = new PrintWriter(sw);
      e.printStackTrace(pw);
      String message = sw.toString();
      return message;
   }

}
